package com.yunfei.yikao.web.dao;

import com.yunfei.yikao.web.dataobject.ZhangyunfeiYikao;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface ZhangyunfeiYikaoMapper {
    @Delete({
        "delete from zhangyunfei_yikao",
        "where email = #{email,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String email);

    @Insert({
        "insert into zhangyunfei_yikao (email, name, ",
        "domainName, password)",
        "values (#{email,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
        "#{domainname,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR})"
    })
    int insert(ZhangyunfeiYikao record);

    @Select({
        "select",
        "email, name, domainName, password",
        "from zhangyunfei_yikao",
        "where email = #{email,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="domainName", property="domainname", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR)
    })
    ZhangyunfeiYikao selectByPrimaryKey(String email);

    @Select({
        "select",
        "email, name, domainName, password",
        "from zhangyunfei_yikao"
    })
    @Results({
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="domainName", property="domainname", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR)
    })
    List<ZhangyunfeiYikao> selectAll();

    @Update({
        "update zhangyunfei_yikao",
        "set name = #{name,jdbcType=VARCHAR},",
          "domainName = #{domainname,jdbcType=VARCHAR},",
          "password = #{password,jdbcType=VARCHAR}",
        "where email = #{email,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(ZhangyunfeiYikao record);
}